const calculateExperienceForLevel = (level) => {
    return Math.floor(100 * Math.pow(1.2, level - 1));
};

const calculateLevelProgress = (currentExperience, level) => {
    const requiredExperience = calculateExperienceForLevel(level);
    return Math.floor((currentExperience / requiredExperience) * 100);
};

const calculateRewards = (difficulty, isDaily = false) => {
    const baseRewards = {
        easy: { experience: 5 },
        medium: { experience: 15 },
        hard: { experience: 30 }
    };

    const rewards = { ...baseRewards[difficulty] };
    if (isDaily) {
        rewards.experience = Math.floor(rewards.experience * 0.8);
    }
    return rewards;
};

module.exports = {
    calculateExperienceForLevel,
    calculateLevelProgress,
    calculateRewards
};